package com.xunk.scene.interceptor;

import com.xunk.common.core.utils.DataUtils;
import com.xunk.common.core.utils.DateUtils;
import com.xunk.common.core.utils.StringUtils;
import com.xunk.scene.constant.SceneConstant;
import com.xunk.scene.domain.TaskSchedule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.InputStream;
import java.util.Map;


/**
 * @ProjectName: HIM
 * @Package: com.xunk.scene.interceptor
 * @ClassName: TimerInterceptor
 * @Author: tangguangyuan
 * @Description: 定时任务拦截器
 * @Date: 2021/5/7 16:24
 * @Version: 1.0
 */
@Component
public class TimerInterceptor extends HandlerInterceptorAdapter {
    private static final Logger log = LoggerFactory.getLogger(TimerInterceptor.class);

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        /*//法定工作日的判断
        String date = DateUtils.getDate();
        String jobType = request.getParameter("jobType");
        if(StringUtils.isNotEmpty(jobType)&&jobType.equals(SceneConstant.workDate)){
            boolean result =  SceneConstant.noWorkDates.contains(date);
            return !result;
        }*/

        return super.preHandle(request, response, handler);
    }
}